/******************************************************************
 * @version      : 1.0
 * @Author       : zhl
 * @Date         : 2023-06-27 17:21:59
 * @LastEditors  : zhl
 * @E-Mail       : zhll168@163.com
 * @Description  : 业务描述
 ******************************************************************/
#ifndef __LINK_MANAGER_H__
#define __LINK_MANAGER_H__

#include "stdint.h"
#include "APDU.h"
#include "DLT698-Frame.h"
#include "CConfigManager.h"


class LinkManager
{
private:
    /* data */
    static LinkManager c_link_manager;
    uint8_t *c_link_data;
    int      c_link_data_len;

public:
    LinkManager(/* args */);
    ~LinkManager();

    static LinkManager& getInstance();
    int  get_link_frame(APDU& apdu);
    uint8_t *get_link_request_frame(LINK_REQUEST_TYPE type, uint16_t heartbeat_interval);
    uint8_t *get_link_response_frame(LINK_REQUEST_TYPE type, uint16_t heartbeat_interval);
    int get_link_apdu_length();
    int link(std::weak_ptr<CConfigManager> cm);
};


#endif /* __LINK_MANAGER_H__ */